<template>
	<view>
		<u-navbar leftIconColor="#000000" :titleStyle="{ color: '#000000' }" :bgColor="bgColor" title="直属下级"
			:placeholder="true" :autoBack="true"></u-navbar>

		<view class="note">

		</view>
		<!-- <u-swiper height="150" :list="list1"></u-swiper> -->
		<view style="padding: 15px;position: relative;z-index: 1;">

			<!-- <view style="font-size: 16px; font-weight: bold; color: #1d1f20; margin-top: 15px">团队统计</view> -->
			<view class="flex"
				style="margin-top: 15px;background-color: #fff;border-radius: 10px;padding: 20px 42px;justify-content: space-between;">
				<view class="flex" style="margin-right: 10px;justify-content: center;">
					<view class="flex">
						<view class=""
							style="width: 7px;height: 7px;border-radius: 50%;background-color: #0074FE;margin-right: 15px;">
						</view>
						<view class="flex" style="text-align: center;flex-direction: column;align-items: flex-start;">
							<view style="font-size: 12px; margin-bottom: 10px; color: #767c86">直接代理人数（人）</view>
							<view style="font-size: 16px; font-weight: bold; color: #0773FD">{{ info.monthTeamNum }}
							</view>
						</view>
					</view>
				</view>
				<view class="flex" style=" justify-content: center">
					<view class="flex">
						<view class=""
							style="width: 7px;height: 7px;border-radius: 50%;background-color: #FF5500;margin-right: 15px;">
						</view>
						<view class="flex" style="text-align: center;flex-direction: column;align-items: flex-start;">
							<view style="font-size: 12px; margin-bottom: 10px; color: #767c86">团队总人数（人）</view>
							<view style="font-size: 16px; font-weight: bold; color: #FF5500">{{ info.monthSubTeamNum }}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="flex" style="justify-content: space-between;padding: 15px 0 0;">
				<view class="">
					<text>成员列表</text>
				</view>
				<view class="" style="width: 60%;">
					<u-search @search="list" bgColor="#fff" @custom="list" v-model="search" :showAction="true"
						actionText="搜索" :animation="true"></u-search>
				</view>
			</view>
			<view v-if="art" class="" style="padding-top: 15px;border-radius: 10px">
				<u-steps direction="column" dot activeColor="#6F88FF" inactiveColor="#6F88FF">
					<u-steps-item v-for="(it, i) in arr" :key="i">
						<view slot="desc" class="iy" style="background-color: #f7f9fa; border-radius: 0 0 10px 10px">
							<image class="bcg" src="/static/image/4-3.png"></image>
							<view class="iy-wrap">
								<view class="username">{{ it.username }}</view>
								<view class=" data" style="height: 68px;">
									<view class="flex"
										style="padding: 13px 15px;flex-direction: column;align-items: flex-start;">
										<view class="flex">
											<view>手机号</view>
											<view>{{ it.mobile }}</view>
										</view>
										<view class="flex"
											style="justify-content: space-between;width: 100%;padding-top: 12px;">
											<view class="flex">
												<view>团队人数：</view>
												<view>{{ it.total_team_num }}</view>
											</view>
											<view class="flex">
												<view>给我创造的收益：</view>
												<view>￥{{ it.settmoney_sum == null ? 0 : it.settmoney_sum }}</view>
											</view>
										</view>
									</view>
								</view>
								<view class="flex aa" style="width: 100%;justify-content: flex-end;padding-top: 12px;">
									<view class="ab">注册时间：</view>
									<view class="ac" style="color: #F5954E;">{{ it.createtime }}</view>
								</view>
							</view>

						</view>
					</u-steps-item>
				</u-steps>
			</view>
			<view v-else class="" style="padding-top: 15px;border-radius: 10px">
				
				<!-- <u-steps direction="column" dot activeColor="#6F88FF" inactiveColor="#6F88FF"> -->
				<!-- <u-steps-item v-for="(it, i) in arr" :key="i"> -->
				<view v-for="(it, i) in arr" :key="i">
					<view class="iys" style="background-color: #f7f9fa; border-radius: 0 0 10px 10px">
						<image class="bcg" src="/static/image/4-3.png"></image>
						<view class="iy-wraps">
							<view class="username">{{ it.username }}</view>
							<view class="data" style="height: 68px;">
								<view class="flex"
									style="padding: 13px 15px;flex-direction: column;align-items: flex-start;">
									<view class="flex">
										<view>手机号</view>
										<view>{{ it.mobile }}</view>
									</view>
									<view class="flex"
										style="justify-content: space-between;width: 100%;padding-top: 12px;">
										<view class="flex">
											<view>团队人数：</view>
											<view>{{ it.total_team_num }}</view>
										</view>
										<view class="flex">
											<view>给我创造的收益：</view>
											<view>￥{{ it.settmoney_sum == null ? 0 : it.settmoney_sum }}</view>
										</view>
									</view>
								</view>
							</view>
							<view class="flex aa" style="width: 100%;justify-content: flex-end;padding-top: 12px;">
								<view class="ab">注册时间：</view>
								<view class="ac" style="color: #F5954E;">{{ it.createtime }}</view>
							</view>
						</view>

					</view>
				</view>
				<!-- </u-steps-item> -->
				<!-- </u-steps> -->
			</view>
			<!-- 			<view v-for="(it, i) in arr" :key="i" style="">
				<view class="flex" style="justify-content: space-between;position: relative;">
					<view :class="[i == 0 ? 'tops flex' : 'flex'] " style="flex-direction: column;position: relative;">
						<view :class="[i == 0 ? 'toppp' : 'toppps']" style="background: linear-gradient(141deg, #92A6FF 0%, #4969FF 100%);box-shadow: 0px 2 5px 0px rgba(0,0,0,0.1);
							border: 1px solid #FFFFFF;width: 11px;height: 11px;border-radius: 50%;">
						</view>
						<view class="" style="height: 132px;width: 1px;background-color: #D8D8D8;">
						</view>
					</view>
					<view class="listcom" style="border-radius: 10px;width: 95%;">
						<view class="flex" style="padding: 14px 23px; flex-wrap: wrap">
							<view class="flex aa" style="width: 45%">
								<view class="ac">{{ it.username }}</view>
							</view>
							<view class="flex" style="background-color: #FCFCFC;border: 1px dashed #D3D3D3;padding: 13px 15px;margin: 14px 0;
							flex-direction: column;align-items: flex-start;width: 100%;border-radius: 5px;">
								<view class="flex aa" style="width: 55%">
									<view class="ab">手机号：</view>
									<view class="ac">{{ it.mobile }}</view>
								</view>
								<view class="flex" style="justify-content: space-between;width: 100%;padding-top: 10px;">
									<view class="flex aa" style="width: 45%">
										<view class="ab">团队人数：</view>
										<view class="ac">{{ it.total_team_num }}人</view>
									</view>
									<view class="flex aa" style="width: 55%">
										<view class="ab">给我创造的收益：</view>
										<view class="ac">{{ it.settmoney_sum }}元</view>
									</view>
								</view>
							</view>
							<view class="flex aa" style="width: 100%;justify-content: flex-end;">
								<view class="ab">注册时间：</view>
								<view class="ac" style="color: #F5954E;">{{ it.createtime }}</view>
							</view>
						</view>
					</view>
				</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// list1: [],
				search: '',
				info: '',
				arr: [],
				bgColor: 'rgba(255,255,255,0)',
				art: true,
			};
		},
		onPageScroll(e) {
			if (e.scrollTop > 50) {
				this.bgColor = 'rgba(255,255,255,1)'
			} else {
				this.bgColor = 'rgba(255,255,255,0)'
			}
		},
		onLoad() {
			this.list();
		},
		methods: {
			async list() {
				if (this.search == '') {
					this.art = true
				} else {
					this.art = false
				}
				let res = await this.$http.car.directTeam({
					search: this.search,
				});
				if (res.code == 1) {
					this.info = res.data;
					this.arr = res.data.directTeamList;
					console.log(this.arr);
					console.log(!this.art);
				}

			},
		},
	};
</script>

<style scoped lang="scss">
	.ar {
		width: 194px;
		height: 10px;
		background: linear-gradient(90deg, #ff3331 0%, rgba(255, 51, 49, 0) 100%);
		border-radius: 10px 0px 0px 0px;
		opacity: 0.4;
	}

	.aa {
		width: 50%;
		// margin-bottom: 10px;

		&:last-child {
			margin-bottom: 0px !important;
		}

		.ab {
			font-size: 12px;
			font-weight: 400;
			color: #686e7a;
		}

		.ac {
			font-size: 12px;
			font-weight: 400;
			color: #040e21;
		}
	}

	.note {
		background-image: url('@/static/font/21.png');
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		background-size: 100% 100%;
	}

	.flex {
		display: flex;
		align-items: center;
	}

	.listcom {
		background-image: url('@/static/font/60.png');
		height: 132px;
		width: 100%;
		background-size: 100% 100%;
	}

	.toppps {
		position: absolute;
		top: 10px;
	}

	.toppp {
		position: absolute;
		top: 25px;
	}

	.tops {
		padding-top: 30px !important;
	}

	.iys {
		position: relative;
		top: -10px;
		border-radius: 10px;
		border-bottom: 1px solid #f3f3f3;
		background-color: transparent !important;
		font-size: 13px;

		.bcg {
			position: absolute;
			top: 0;
			left: 0;
			z-index: -1;
			width: 100%;
			height: 100%;
		}

		.iy-wraps {
			padding: 22px 30px;
		}

		.username {
			margin-bottom: 13px;
			font-weight: bold;
			color: #333333;
			line-height: 13px;
		}

		.data {
			border: 1px dashed #d3d3d3;
			border-radius: 5px;
			background-color: #fcfcfc;

			.item {
				flex: 1;
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: space-evenly;
				text-align: center;

				>view:nth-child(1) {
					font-weight: bold;
				}
			}
		}
	}


	.iy {
		position: relative;
		top: -10px;
		border-radius: 10px;
		border-bottom: 1px solid #f3f3f3;
		background-color: transparent !important;
		font-size: 13px;

		.bcg {
			position: absolute;
			top: 0;
			left: 0;
			z-index: -1;
			width: 100%;
			height: 100%;
		}

		.iy-wrap {
			padding: 22px 30px;
		}

		.username {
			margin-bottom: 13px;
			font-weight: bold;
			color: #333333;
			line-height: 13px;
		}

		.data {
			border: 1px dashed #d3d3d3;
			border-radius: 5px;
			background-color: #fcfcfc;

			.item {
				flex: 1;
				height: 100%;
				display: flex;
				flex-direction: column;
				justify-content: space-evenly;
				text-align: center;

				>view:nth-child(1) {
					font-weight: bold;
				}
			}
		}
	}

	/deep/ .u-steps-item__wrapper {
		background-color: transparent;
	}

	/deep/ .u-steps-item__line--column {
		background: #d8d8d8 !important;
	}
</style>
<style>
	page {
		background-color: #f7f9fa;
	}
</style>